package com.gylang.auth.message;

import com.gylang.common.model.mail.MailBean;
import com.gylang.common.model.mail.TemplateMailBean;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author gylang,
 * @data 2019/12/3 8:48,
 * @DESC
 */
@Component
public class MailMessage {

    @Autowired
    private AmqpTemplate amqpTemplate;

    public void sendTemplate(TemplateMailBean templateMailBean) {
        amqpTemplate.convertAndSend("templateMail", templateMailBean);
    }

    public void sendDf(MailBean mailBean) {
        amqpTemplate.convertAndSend("dfMail", mailBean);
    }

}
